package org.gang.config;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.gang.util.GFile;
import org.gang.util.GLogger;

import java.io.File;

/**
 * Some Gang Intelligent code
 * Please visit http://gang.dinfo.ru for more info
 *
 * @author Vitaly
 * @since 19.04.2007 11:03:58
 */
public class AccountConfiguration extends Configuration {
    private final static String ACCOUNT_CFG = getRootConfigDirectory() + "accounts.dat";

    AccountConfiguration()
    {
        File cfgFile = new File(ACCOUNT_CFG);
        if (!cfgFile.exists())
        {
            Document xmlDoc = DocumentHelper.createDocument(DocumentHelper.createElement("accountconfiguration"));

            try
            {
                GFile.write(ACCOUNT_CFG, xmlDoc.asXML());
            } catch (Exception ex)
            {
                GLogger.getInstance().fatal(ex.getLocalizedMessage());
                ex.printStackTrace();
            }
        }
    }
}
